<!DOCTYPE html>
<html>
<head>
	<title>Extended marking</title>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
	<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
	<link rel="stylesheet" type="text/css" href="../../../codebase/fonts/font_roboto/roboto.css"/>
	<link rel="stylesheet" type="text/css" href="../../../codebase/dhtmlx.css"/>
	<script src="../../../codebase/dhtmlx.js"></script>
	<script>
		var myGrid, myDataProcessor;
		function doOnLoad(){
		// init grid and set its parameters (this part as always)
		myGrid = new dhtmlXGridObject('gridbox');
		myGrid.setImagePath("../../../codebase/imgs/");
		myGrid.setHeader("Status,Book Title,Author,Price,In Store,Shipping,Bestseller,Date of Publication");
		myGrid.setInitWidths("80,150,100,80,80,80,80,100");
		myGrid.setColAlign("right,left,left,right,center,left,center,center");
		myGrid.setColTypes("ro,ed,txt,price,ch,coro,ch,ro");
		myGrid.setColSorting("int,str,str,int,str,str,str,date");
		myGrid.init();
		myGrid.enableAutoWidth(true);
		myGrid.load("php/get.php",function(){
			myGrid.forEachRow(function(id){
				myGrid.cells(id,0).setValue("");
			})
		}); // used just for demo purposes
		//
		myDataProcessor = new dataProcessor("php/update_mark.php"); // lock feed url
		myDataProcessor.init(myGrid); // link dataprocessor to the grid
		myDataProcessor.setUpdateMode("off"); // link dataprocessor to the grid
		myDataProcessor.attachEvent("onRowMark",function(id,status,mode){
			if (status)
				myGrid.cells(id,0).setValue(mode);
			else
				myGrid.cells(id,0).setValue("saved");
			return false;
		});
	}
	</script>
</head>
<body onload="doOnLoad()">
	<div id="gridbox" style="width:750px;height:350px;overflow:hidden"></div>
	<p><a href="javascript:void(0)" onclick="myGrid.addRow((new Date()).valueOf(),[0,'','','',false,'na',false,''],myGrid.getRowIndex(myGrid.getSelectedId()))">Add row</a></p>
	<p><a href="javascript:void(0)" onclick="myGrid.deleteSelectedItem()">Remove Selected Row</a></p>
	<input type="button" name="some_name" value="update" onclick="myDataProcessor.sendData();">
</body>
</html>
